package com.seven.first.suite.result;

public enum BaseErrorMessage implements GetErrorMessage {

    /**
     * 入参错误，参数校验错误
     */
    BAD_REQUEST(400, "Bad Request"),

    /**
     * 没有token信息
     */
    UNAUTHORIZED(401, "Unauthorized"),

    /**
     * 没有访问权限
     */
    FORBIDDEN(403, "Forbidden"),

    /**
     * 访问路径不存在
     */
    NOT_FOUND(404, "Not Found"),

    /**
     * 访问超时
     */
    REQUEST_TIMEOUT(408, "Request Timeout"),

    /**
     * 重复提交，冪等問題
     */
    REPEATED_SUBMISSION(499, "Repeated Submission"),

    /**
     * 服务器错误
     */
    INTERNAL_SERVER_ERROR(500, "Internal Server Error"),

    /**
     * 网关错误
     */
    BAD_GATEWAY(502, "Bad Gateway"),

    /**
     * 网关超时
     */
    GATEWAY_TIMEOUT(504, "Gateway Timeout"),

    /**
     * 会话安全验签失败
     */
    ONCE_SECURE_ERROR(4001, "Once Secure Error"),

    /**
     * 数据库重要数据被篡改，加解密验签失败
     */
    SIGNATRUE_ERROR(4002, "Signature Error");

    private int status;
    private String message;

    private BaseErrorMessage(int status, String message) {
        this.status = status;
        this.message = message;
    }

    @Override
    public int getStatus() {
        return this.status;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
